package com.baitiaojun.api.domain.user;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ApiModel("当前用户和关注所用户的关联关系")
public class UserFollowing {

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(readOnly = true)
    private Long id;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(readOnly = true)
    private Long userid;

    @JsonSerialize(using = ToStringSerializer.class)
    @NotNull(message = "所要关注的用户userinfoId不能为空")
    @ApiModelProperty(value = "当前用户所关注的用户userinfoId", required = true)
    private Long followingid;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty("关注的用户所属分组的id")
    private Long groupid;

    @ApiModelProperty(readOnly = true)
    private Date createtime;

    @ApiModelProperty(hidden = true)
    private UserInfo userInfo;
}